package
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import com.airlogger.AirLoggerDebug;
	import com.bourre.structures.Point;	

	public class AirLoggerDemo extends Sprite
	{
		public function AirLoggerDemo()
		{
			stage.addEventListener(Event.ACTIVATE, onActivate );
			stage.addEventListener(MouseEvent.MOUSE_UP, onClick );

			//Logger.getInstance().addLogListener( FlashInspectorLayout.getInstance() );
			//Logger.getInstance().addLogListener( AirLoggerLayout.getInstance(), PixlibDebug.CHANNEL );
			
			var xml : XML = <someNode>
								<innerNode>content</innerNode>
								<innerNode>content with a great number of words in the content to force the wrapping of the text in the display</innerNode>
						  	</someNode>;
			
			var a : Array = new Array( 26, 
									   "a string with a color #f3f67f, a link http://www.foo.com and a mail foo@foo.com",
									   "a string without color",
									   false,
									   {foo:"hey"},
									   [0,10,20],
									   <somexml><node>foo</node></somexml>
									  );
					  	
			var obj : Object = {a:1,
								b:"a string with a color #ffffff, a link http://www.foo.com and a mail foo@foo.com",
								c:"a string without color",
								d:false, 
								e:{foo:"hey"}, 
								f:[0,10,20],
								g:<somexml><node>foo</node></somexml>
							   };
			
			AirLoggerDebug.getInstance().setName( "Stand alone" );
					
			AirLoggerDebug.debug( "Lorem ipsum dolor sit amet, consetetur sadipscing elitr... shut up!!!" );
			AirLoggerDebug.debug( "<b>Some <xml/> tags in a string</b>," +
								  "a link http://labs.prizee.com/" +
								  ", a mail cedric_nehemie@prizee.fr" +
								  "\n\n\tand some newline and tab chars" );
			AirLoggerDebug.debug( "Some colors in a string, 0xff6600, #ff9933, ff669f, really usefull isn't it ?" );
			
			AirLoggerDebug.info( xml);
			AirLoggerDebug.info( [] );				AirLoggerDebug.warn( a );			
			AirLoggerDebug.error( obj );
			AirLoggerDebug.fatal( new Point ( 6, 4 ) );
			AirLoggerDebug.fatal( null );
		}
		public function onClick( e : MouseEvent ) : void
		{
			//PixlibDebug.INFO( "Lorem ipsum dolor sit amet, consetetur sadipscing elitr" );
			//AirLoggerDebug.info( new Shape() );
			AirLoggerDebug.info( "Lorem ipsum dolor sit amet, consetetur sadipscing elitr" );
			AirLoggerDebug.getInstance().setName( "Ismaël" );
		}
		public function onActivate ( e : Event ) : void
		{
			AirLoggerDebug.getInstance().focus();
		}	
	}
}